UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0YpJmYCYeqU11IT9ZE55iWISy6i4bArUaA6chUDLbRc='
WHERE
key_id = '69220aaf3f1cbaf9ee36dda7343fbdc79b9dd7ca252075178b0b5a177dd3e9eb'
AND (
token = '0YpJmYCYeqU11IT9ZE55iWISy6i4bArUaA6chUDLbRc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)