UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TnZQ32ts09L1DaeLGKHLAq4i7rWN3wKbRchanSscUcE=' 
WHERE 
  key_id = '99159074dbff7ad93de576c8a6d7de824bde7b58fd435000db352a1d722e4cc0' 
  AND (
    token = 'TnZQ32ts09L1DaeLGKHLAq4i7rWN3wKbRchanSscUcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030