UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'watyQ8BwwWJbr8Rsq0bKuWIIt8N5x476gV8yXX5LXJA='
WHERE
key_id = 'dd720a364c63b7c0355238dad1559703e26d0c6cd7447d575ce75bb4efdb8932'
AND (
token = 'watyQ8BwwWJbr8Rsq0bKuWIIt8N5x476gV8yXX5LXJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)