UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PV1Vb7QW3hrtxZlstQ9wSLPTQog5gypQ+cedG+cASZY='
WHERE
key_id = '19a72e44e03677703152ba4e9a22c76887622b90b784759cfa7e221380971d01'
AND (
token = 'PV1Vb7QW3hrtxZlstQ9wSLPTQog5gypQ+cedG+cASZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)