UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o5anEfbr7Q7idF5wzgOQQr1JfePI7sEl/ILk6TyBi7c='
WHERE
key_id = '28cbefdc11c378cd2098edcc21379122647aa8ec2d137b9003ac04e678741ba2'
AND (
token = 'o5anEfbr7Q7idF5wzgOQQr1JfePI7sEl/ILk6TyBi7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)