UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OSmjEdlcNGIdKj7b5hIOEvjzTfuSsTeqSkT/wpp6wLI='
WHERE
key_id = '2de15b5da83415717ae6c642711883e2b58ff4619aabd29f336d055b9ed19aa3'
AND (
token = 'OSmjEdlcNGIdKj7b5hIOEvjzTfuSsTeqSkT/wpp6wLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)