UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yZ+k9aQBAtunuNd5RkKJI95rLATiYP7DCXXsQ0pS9Yg='
WHERE
key_id = 'fca1f018ead1f874465254d37d00e9c2b334310f881e9474d96829f21890362b'
AND (
token = 'yZ+k9aQBAtunuNd5RkKJI95rLATiYP7DCXXsQ0pS9Yg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)