UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rOpsb+bxILb5aj5ZUakhalau4drYm37GsndI2tA2mrk='
WHERE
key_id = '836ad0431b4628ee2a822b244b00f736d4e5b01b2bf75a54565f964c27359eae'
AND (
token = 'rOpsb+bxILb5aj5ZUakhalau4drYm37GsndI2tA2mrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)