UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u3/7m/hZAa3UGexvw9Y4K5+3RevjkuLHipMiQB+SxcY=' 
WHERE 
  key_id = '3b85957ca22b07841b4a4475aab75436d488e92e13fea09e0c7be4d8ff0620ee' 
  AND (
    token = 'u3/7m/hZAa3UGexvw9Y4K5+3RevjkuLHipMiQB+SxcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027