UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zOy0g3ipE21083b37k82LcGVOtvSvS92yk2NhgVIKkA=' 
WHERE 
  key_id = '0123722e01c8ed9b6d17f80f16828c65ce5facfe889d3cb62f15be4a566d4652' 
  AND (
    token = 'zOy0g3ipE21083b37k82LcGVOtvSvS92yk2NhgVIKkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032