UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tGUTY7AFVPkLTMYMiGjWnDlYGz23GJmEp4nToo0BKuo='
WHERE
key_id = '15b58d1667987f3a6a567e9c62aed2327ec5e7604b64227834e68b1afac502a5'
AND (
token = 'tGUTY7AFVPkLTMYMiGjWnDlYGz23GJmEp4nToo0BKuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)