UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GMhKDRpbWclxaTHrYWDJiVrGV/+P7LbAhe7poLgUTqk=' 
WHERE 
  key_id = '0a3db3da50759a968c593f50d71ee77de2390254df5f8e3788576dd22e1841c2' 
  AND (
    token = 'GMhKDRpbWclxaTHrYWDJiVrGV/+P7LbAhe7poLgUTqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023