UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EPBz20oxMaccp4v9XI3Wk2BDo1+2v6SNPaNKzh+q+ag='
WHERE
key_id = '0f8207c91471336c3ed54b3ad2fc5ed46a07daa00d3b22637c1ba91b40ebd754'
AND (
token = 'EPBz20oxMaccp4v9XI3Wk2BDo1+2v6SNPaNKzh+q+ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)