UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0DvzEbbQ5hEtZ8yVa7ukvObLfe81K3cD96u5ENEipNo=' 
WHERE 
  key_id = '56b11bfbaa8d4d62d9a53aa29f70c63765e77b039d27b97cc2df63a34348bf4c' 
  AND (
    token = '0DvzEbbQ5hEtZ8yVa7ukvObLfe81K3cD96u5ENEipNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034