UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hkTH55/uOCoLVygvWXB6j+fHDvOGkEHJQjIc3V3dTa4=' 
WHERE 
  key_id = 'c96f4a2afc401e9bacecfa433edcfa206fbfb47cec0a9fb98e231a0fa98d491a' 
  AND (
    token = 'hkTH55/uOCoLVygvWXB6j+fHDvOGkEHJQjIc3V3dTa4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036