UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LsaocOGjuyaTpqjBMvupdefvRCXIa7rk6HhdrXbK86E='
WHERE
key_id = 'ab261d587a7ecd0b897a35de7453617044b9129f4faea8863d84de6d48eaafe2'
AND (
token = 'LsaocOGjuyaTpqjBMvupdefvRCXIa7rk6HhdrXbK86E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)