UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X64dD1OwdxpidHrVnGSfghadYO7qW3jdutO0zD9bt1o='
WHERE
key_id = '6363233e9a14eb790dfe5fcd68dcdd30b400a1056d12d9a7907b1937018a7fd0'
AND (
token = 'X64dD1OwdxpidHrVnGSfghadYO7qW3jdutO0zD9bt1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)