UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RQTReE/TPGlDgHnTvnKD96levcbvOM6nzqlYoDanXqU=' 
WHERE 
  key_id = '8ad37267c1dfb6a2a0b40e42587b58e9915cb6e6f3399cf1d013f3fc26e50eea' 
  AND (
    token = 'RQTReE/TPGlDgHnTvnKD96levcbvOM6nzqlYoDanXqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022