UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xZdkSOg3jP+0ejP/s1L362LDW7mxzUQdhY/ITSKRUzk='
WHERE
key_id = '1ff5540a9550b00c395df4652a2a8bfb901637be4450534c5e31f11602c580bb'
AND (
token = 'xZdkSOg3jP+0ejP/s1L362LDW7mxzUQdhY/ITSKRUzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)