UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dJeW+pIHcta6yVSh6vHWhWegugALEgmwn0iC+uZzR4Y=' 
WHERE 
  key_id = '7575a753a5c1bfa728c0ad7e622775f00b4184e85544ef12c02b99aaaa9b1af0' 
  AND (
    token = 'dJeW+pIHcta6yVSh6vHWhWegugALEgmwn0iC+uZzR4Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033