UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n2tS1vjK+mXzShhPPFDDlp9ecIr0krmJ+cXj+1cg4is='
WHERE
key_id = '734adcf73005f6e5756186d74cc11d2d966e6d3ecdb43a472d23d8f29436e831'
AND (
token = 'n2tS1vjK+mXzShhPPFDDlp9ecIr0krmJ+cXj+1cg4is='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)