UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zvEEiYywpW31EFuQUOFtrAo1BneUZFp8PSFoTLYUP5E='
WHERE
key_id = 'b20d4234d501913c21bf0bdda3c4f109f8a6d5a703fd4158cf8dc8721f2e4775'
AND (
token = 'zvEEiYywpW31EFuQUOFtrAo1BneUZFp8PSFoTLYUP5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)