UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OHbhTvX2dmYlYEqxtZ3Gc572228fGsHlpLFkRK4shb0='
WHERE
key_id = '9551f752335da1d4057ee8ecdf94e2fcdc869756d438e22cd0ddaf3ce3529339'
AND (
token = 'OHbhTvX2dmYlYEqxtZ3Gc572228fGsHlpLFkRK4shb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)