UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WRHWQcuE1sEz/7f2kbT7agLERwS/3fXcePiaGAl+fdM='
WHERE
key_id = 'af7791e0360cfaec85931e8a1958c4a6c8d1675288fc177ed39e40fcda8d2e97'
AND (
token = 'WRHWQcuE1sEz/7f2kbT7agLERwS/3fXcePiaGAl+fdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)