UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YTS4I03eLI5xDkvAo+8TMXZ2dn7emih11QmXNlcgsV8='
WHERE
key_id = '4b9e2e83f74820e844b73e71d67f48a168e5e69ddd779ca9c9f78b1cb0ce17aa'
AND (
token = 'YTS4I03eLI5xDkvAo+8TMXZ2dn7emih11QmXNlcgsV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)