UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qBPO8sJ3w6Vp1okK/O5nQZib0iI1wER3bxzfYb9CipQ=' 
WHERE 
  key_id = 'a265ffb03460d18d36afda74596ef22e04ec4b49f89e06bfcf78fc6268d19f02' 
  AND (
    token = 'qBPO8sJ3w6Vp1okK/O5nQZib0iI1wER3bxzfYb9CipQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029