UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+2GmtS58FohpBBvUOPJ8Nb1LqzJzcmMKzmRX33TjGgM=' 
WHERE 
  key_id = '318ada6f6723b783fe756b783f12dc1019db8cbec9e5fcb83ef6f262ef04fcb4' 
  AND (
    token = '+2GmtS58FohpBBvUOPJ8Nb1LqzJzcmMKzmRX33TjGgM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022