UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FDXQlhhBMt8ilIt9k5ovnet9/+ELtDMHa28YrsAqlQ8=' 
WHERE 
  key_id = 'a2b508f1321dbf0c7c0402fdc1a942d77ba5dec63bc879f021006352e65df56c' 
  AND (
    token = 'FDXQlhhBMt8ilIt9k5ovnet9/+ELtDMHa28YrsAqlQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027