UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3CwjYPAuGMk8Xn2YWYY6u1Rure3hVUTtHt2q2dckQm4='
WHERE
key_id = '0a704a7f875a65ac2b2216c3d4af013052a1e996d4811a84fe7edad66c80cfb2'
AND (
token = '3CwjYPAuGMk8Xn2YWYY6u1Rure3hVUTtHt2q2dckQm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)