UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P75+znc63VwCthJ9F5e4VW3If5ZkR08dghIQkJX4BX8='
WHERE
key_id = 'e5edcb8630890e8be6eb08aa530fd362e5d791f9e9cc5fe95caabed3bd03c8d7'
AND (
token = 'P75+znc63VwCthJ9F5e4VW3If5ZkR08dghIQkJX4BX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)