UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oGaReUvGvWpWBRB1j9Yz84Co1zZ2/8B8fe2gjZEaZmE='
WHERE
key_id = 'b6beee83406c6cf46e5516dbf61533ee543e460448d11b9f3281347accfd39e3'
AND (
token = 'oGaReUvGvWpWBRB1j9Yz84Co1zZ2/8B8fe2gjZEaZmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)