UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l2sAS/diBCvCB8sYzpaj/vmpv5Aj7uBchrHu3INOsfM=' 
WHERE 
  key_id = '11fb42d8762710c36b4a1ca83138936099acd15ae68161103f0a1b3c4b54b2c3' 
  AND (
    token = 'l2sAS/diBCvCB8sYzpaj/vmpv5Aj7uBchrHu3INOsfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045