UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qE2sMVWqtPb5L1U2B+hSpIAdG/c+F3BjQi44J19Z0RI=' 
WHERE 
  key_id = '41a52385f5ad11ddec52aadec13facbb8c8ff6ac5536c94d0a5b9c2f207b6762' 
  AND (
    token = 'qE2sMVWqtPb5L1U2B+hSpIAdG/c+F3BjQi44J19Z0RI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017