UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1CPdTF75J5No30IWjyBqk2x4xyl8rUTeW7kemcR7R1s='
WHERE
key_id = '7ff105e6502014b74f340fc9154fd0401a055a924f384bf1943a93a9ee483fbc'
AND (
token = '1CPdTF75J5No30IWjyBqk2x4xyl8rUTeW7kemcR7R1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)