UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/c3MydqwbF7uCStH6EpBSdlja9GlbIa4TCeGeI6KIYY=' 
WHERE 
  key_id = '215c24a9e45cc5033e562deba862c218afa283db8db6bb919f0b14a27a8bed0b' 
  AND (
    token = '/c3MydqwbF7uCStH6EpBSdlja9GlbIa4TCeGeI6KIYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017