UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y+QZfBcgYwrjMqKp/B3P5OPkbY3mN0Hn6ect6dBtNic=' 
WHERE 
  key_id = 'ab43de3761eb3550823da24e2745ace79814a64529eac67b72ee8abc5cafa660' 
  AND (
    token = 'y+QZfBcgYwrjMqKp/B3P5OPkbY3mN0Hn6ect6dBtNic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031