UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+2qnhSdsP6GXpCzwMt5k2E7a+1k0HuPbAVIdYz/F6oA=' 
WHERE 
  key_id = '8752dbfe557bb1d8a698ce4e8070fdfa783a44a36ce941cabad755a9193003ca' 
  AND (
    token = '+2qnhSdsP6GXpCzwMt5k2E7a+1k0HuPbAVIdYz/F6oA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017