UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ug07IHP/wU/pE9hqZLDs1tr9ewV16qvwwWFMJgGWHdA='
WHERE
key_id = '2191288e1b20728725fde47a4407b78546fb3563a8409db788acc8b914a94ea3'
AND (
token = 'ug07IHP/wU/pE9hqZLDs1tr9ewV16qvwwWFMJgGWHdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)