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