UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zWqyayU+yAHOoV0lESFJ97Xc6BOCl4+oCvYv8kcUwws=' 
WHERE 
  key_id = '351a992d56f5d10bcca78a492d114d8154c8e45fd226cbfa4f46799ab952e3a4' 
  AND (
    token = 'zWqyayU+yAHOoV0lESFJ97Xc6BOCl4+oCvYv8kcUwws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015