UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/S86qvEsVn4uVJ/75surPnQKqXRebONav8oc13kivnc='
WHERE
key_id = 'ffd12f8b5282c523204d836d5dba014d738d962b9746a375f6ceea077d1392b8'
AND (
token = '/S86qvEsVn4uVJ/75surPnQKqXRebONav8oc13kivnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)